// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

/// A dyn-compatible, crate-private version of [super::Environments].
#[async_trait::async_trait]
pub trait Environments: std::fmt::Debug + Send + Sync {
    async fn create_environment(
        &self,
        req: crate::model::CreateEnvironmentRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>>;

    async fn get_environment(
        &self,
        req: crate::model::GetEnvironmentRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Environment>>;

    async fn list_environments(
        &self,
        req: crate::model::ListEnvironmentsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListEnvironmentsResponse>>;

    async fn update_environment(
        &self,
        req: crate::model::UpdateEnvironmentRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>>;

    async fn delete_environment(
        &self,
        req: crate::model::DeleteEnvironmentRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>>;

    async fn execute_airflow_command(
        &self,
        req: crate::model::ExecuteAirflowCommandRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ExecuteAirflowCommandResponse>>;

    async fn stop_airflow_command(
        &self,
        req: crate::model::StopAirflowCommandRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::StopAirflowCommandResponse>>;

    async fn poll_airflow_command(
        &self,
        req: crate::model::PollAirflowCommandRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::PollAirflowCommandResponse>>;

    async fn list_workloads(
        &self,
        req: crate::model::ListWorkloadsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListWorkloadsResponse>>;

    async fn check_upgrade(
        &self,
        req: crate::model::CheckUpgradeRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>>;

    async fn create_user_workloads_secret(
        &self,
        req: crate::model::CreateUserWorkloadsSecretRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::UserWorkloadsSecret>>;

    async fn get_user_workloads_secret(
        &self,
        req: crate::model::GetUserWorkloadsSecretRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::UserWorkloadsSecret>>;

    async fn list_user_workloads_secrets(
        &self,
        req: crate::model::ListUserWorkloadsSecretsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListUserWorkloadsSecretsResponse>>;

    async fn update_user_workloads_secret(
        &self,
        req: crate::model::UpdateUserWorkloadsSecretRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::UserWorkloadsSecret>>;

    async fn delete_user_workloads_secret(
        &self,
        req: crate::model::DeleteUserWorkloadsSecretRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<()>>;

    async fn create_user_workloads_config_map(
        &self,
        req: crate::model::CreateUserWorkloadsConfigMapRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::UserWorkloadsConfigMap>>;

    async fn get_user_workloads_config_map(
        &self,
        req: crate::model::GetUserWorkloadsConfigMapRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::UserWorkloadsConfigMap>>;

    async fn list_user_workloads_config_maps(
        &self,
        req: crate::model::ListUserWorkloadsConfigMapsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListUserWorkloadsConfigMapsResponse>>;

    async fn update_user_workloads_config_map(
        &self,
        req: crate::model::UpdateUserWorkloadsConfigMapRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::UserWorkloadsConfigMap>>;

    async fn delete_user_workloads_config_map(
        &self,
        req: crate::model::DeleteUserWorkloadsConfigMapRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<()>>;

    async fn save_snapshot(
        &self,
        req: crate::model::SaveSnapshotRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>>;

    async fn load_snapshot(
        &self,
        req: crate::model::LoadSnapshotRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>>;

    async fn database_failover(
        &self,
        req: crate::model::DatabaseFailoverRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>>;

    async fn fetch_database_properties(
        &self,
        req: crate::model::FetchDatabasePropertiesRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::FetchDatabasePropertiesResponse>>;

    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::ListOperationsResponse>>;

    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>>;

    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<()>>;

    fn get_polling_error_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_error_policy::PollingErrorPolicy>;

    fn get_polling_backoff_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_backoff_policy::PollingBackoffPolicy>;
}

/// All implementations of [super::Environments] also implement [Environments].
#[async_trait::async_trait]
impl<T: super::Environments> Environments for T {
    /// Forwards the call to the implementation provided by `T`.
    async fn create_environment(
        &self,
        req: crate::model::CreateEnvironmentRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>> {
        T::create_environment(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn get_environment(
        &self,
        req: crate::model::GetEnvironmentRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::Environment>> {
        T::get_environment(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn list_environments(
        &self,
        req: crate::model::ListEnvironmentsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListEnvironmentsResponse>> {
        T::list_environments(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn update_environment(
        &self,
        req: crate::model::UpdateEnvironmentRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>> {
        T::update_environment(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn delete_environment(
        &self,
        req: crate::model::DeleteEnvironmentRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>> {
        T::delete_environment(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn execute_airflow_command(
        &self,
        req: crate::model::ExecuteAirflowCommandRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ExecuteAirflowCommandResponse>> {
        T::execute_airflow_command(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn stop_airflow_command(
        &self,
        req: crate::model::StopAirflowCommandRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::StopAirflowCommandResponse>> {
        T::stop_airflow_command(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn poll_airflow_command(
        &self,
        req: crate::model::PollAirflowCommandRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::PollAirflowCommandResponse>> {
        T::poll_airflow_command(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn list_workloads(
        &self,
        req: crate::model::ListWorkloadsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListWorkloadsResponse>> {
        T::list_workloads(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn check_upgrade(
        &self,
        req: crate::model::CheckUpgradeRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>> {
        T::check_upgrade(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn create_user_workloads_secret(
        &self,
        req: crate::model::CreateUserWorkloadsSecretRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::UserWorkloadsSecret>> {
        T::create_user_workloads_secret(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn get_user_workloads_secret(
        &self,
        req: crate::model::GetUserWorkloadsSecretRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::UserWorkloadsSecret>> {
        T::get_user_workloads_secret(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn list_user_workloads_secrets(
        &self,
        req: crate::model::ListUserWorkloadsSecretsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListUserWorkloadsSecretsResponse>>
    {
        T::list_user_workloads_secrets(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn update_user_workloads_secret(
        &self,
        req: crate::model::UpdateUserWorkloadsSecretRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::UserWorkloadsSecret>> {
        T::update_user_workloads_secret(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn delete_user_workloads_secret(
        &self,
        req: crate::model::DeleteUserWorkloadsSecretRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<()>> {
        T::delete_user_workloads_secret(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn create_user_workloads_config_map(
        &self,
        req: crate::model::CreateUserWorkloadsConfigMapRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::UserWorkloadsConfigMap>> {
        T::create_user_workloads_config_map(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn get_user_workloads_config_map(
        &self,
        req: crate::model::GetUserWorkloadsConfigMapRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::UserWorkloadsConfigMap>> {
        T::get_user_workloads_config_map(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn list_user_workloads_config_maps(
        &self,
        req: crate::model::ListUserWorkloadsConfigMapsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListUserWorkloadsConfigMapsResponse>>
    {
        T::list_user_workloads_config_maps(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn update_user_workloads_config_map(
        &self,
        req: crate::model::UpdateUserWorkloadsConfigMapRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::UserWorkloadsConfigMap>> {
        T::update_user_workloads_config_map(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn delete_user_workloads_config_map(
        &self,
        req: crate::model::DeleteUserWorkloadsConfigMapRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<()>> {
        T::delete_user_workloads_config_map(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn save_snapshot(
        &self,
        req: crate::model::SaveSnapshotRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>> {
        T::save_snapshot(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn load_snapshot(
        &self,
        req: crate::model::LoadSnapshotRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>> {
        T::load_snapshot(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn database_failover(
        &self,
        req: crate::model::DatabaseFailoverRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>> {
        T::database_failover(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn fetch_database_properties(
        &self,
        req: crate::model::FetchDatabasePropertiesRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::FetchDatabasePropertiesResponse>> {
        T::fetch_database_properties(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        T::list_operations(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>> {
        T::get_operation(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<()>> {
        T::delete_operation(self, req, options).await
    }

    fn get_polling_error_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_error_policy::PollingErrorPolicy> {
        T::get_polling_error_policy(self, options)
    }

    fn get_polling_backoff_policy(
        &self,
        options: &gax::options::RequestOptions,
    ) -> std::sync::Arc<dyn gax::polling_backoff_policy::PollingBackoffPolicy> {
        T::get_polling_backoff_policy(self, options)
    }
}

/// A dyn-compatible, crate-private version of [super::ImageVersions].
#[async_trait::async_trait]
pub trait ImageVersions: std::fmt::Debug + Send + Sync {
    async fn list_image_versions(
        &self,
        req: crate::model::ListImageVersionsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListImageVersionsResponse>>;

    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::ListOperationsResponse>>;

    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>>;

    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<()>>;
}

/// All implementations of [super::ImageVersions] also implement [ImageVersions].
#[async_trait::async_trait]
impl<T: super::ImageVersions> ImageVersions for T {
    /// Forwards the call to the implementation provided by `T`.
    async fn list_image_versions(
        &self,
        req: crate::model::ListImageVersionsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<crate::model::ListImageVersionsResponse>> {
        T::list_image_versions(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn list_operations(
        &self,
        req: longrunning::model::ListOperationsRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::ListOperationsResponse>> {
        T::list_operations(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn get_operation(
        &self,
        req: longrunning::model::GetOperationRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<longrunning::model::Operation>> {
        T::get_operation(self, req, options).await
    }

    /// Forwards the call to the implementation provided by `T`.
    async fn delete_operation(
        &self,
        req: longrunning::model::DeleteOperationRequest,
        options: gax::options::RequestOptions,
    ) -> crate::Result<gax::response::Response<()>> {
        T::delete_operation(self, req, options).await
    }
}
